#ifndef __LGUIKNOB_H__
#define __LGUIKNOB_H__

#include "LGUIWindow.h"


enum {
	KNOB_NORMAL = 0,
	KNOB_PLUSMINUS = 1
};

class LGUIKnob : public LGUIWindow  
{
	int value, minValue, maxValue, radius;
	short16 bgColor,lineColor;
	int dragging;
	int lastY;
	const TCHAR *text;
	void clamp()
	{
		if (value<minValue) value=minValue;
		if (value>maxValue) value=maxValue;
	}
	int style;
public:
	LGUIKnob(const TCHAR *text, int id, int _x, int _y, int _w, int _h, int _value, 
		int _min, int _max, int _userdata=-1, int style=0, 
		short16 _bgColor=COLOR(0xf0f0f0), short16 _lineColor=COLOR(0x0));

	virtual ~LGUIKnob();

	void draw(int xoff, int yoff);
	void penDown(int px, int py);
	void penMove(int px, int py, bool pressed);
	void penUp(int px, int py);
	void setValue(int v);
};


#endif //__LGUIKNOB_H__